<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateImgsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('imgs', function (Blueprint $table) {
            $table->increments('id');
            $table->string('type')->comment('类型 101 背景图 102 荣誉资质')->index();
            $table->string('title')->nullable()->comment('标题');
            $table->string('img_url')->comment('地址');
            $table->unsignedInteger('number')->default(0)->comment('显示顺序')->index();
            $table->boolean('is_show')->default(1)->comment('是否显示');
            $table->boolean('is_show_index')->default(1)->comment('是否显示在首页');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('imgs');
    }
}
